<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@taglib uri="http://java.sun.com/jstl/core_rt" prefix="c-rt"%>
<%@page import="com.yaodian100.core.common.utils.ServerValue"%>
<c-rt:set var="midContextPath" value='<%=ServerValue.getMidContextPath()%>'/>
<s:actionerror/>
<s:actionmessage/>
<s:fielderror />
<h1>黑名单管理</h1>
<script language="javascript">
<!--
	$().ready(function(){
		$("#cancelBtn").click(function(){
			closeDialog();
		});
		$("#submitBtn").click(function(){
			if ( $("#blockType option:selected").val() == "" ){
				alert("请选择黑名单等级");
				return false;
			}
			if ($(":input[name='blockStatus']:checked").val() != "Y" && $(":input[name='blockStatus']:checked").val() != "N"){
				alert("请选择黑名单状态");
				return false;;
			}
			
			$.post("${midContextPath}/member/blackList!save.do", $('#blackListForm').serialize(), callbackFun, "json");

			function callbackFun(dataResult){
				if ( dataResult == "" ){
					closeDialog();
					$('a[href="#tabs-3"]').click();
					//location.href="${midContextPath}/member/view.do?memberId=${memberId}";
				}else
					alert(dataResult);
			}
		});
	});
-->
</script>
<s:form action="blackList!save.do" method="post" id="blackListForm">
	<table class="tb-data" width="100%">
		<tr>
			<th>黑名单等级</th>
			<td><s:select id="blockType" value="%{blackList.blockType}" name="blockType" list="blackListStatus.options"
		listKey="key" listValue="value.name" /></td>
		</tr>
  	<tr>
			<th>黑名单状态</th>
			<td><s:radio value="%{blackList.blockStatus}" list="memberBlockStatus.options" listKey="key" listValue="value.name" label="状态" name="blockStatus"/></td>
    </tr>
    <tr>
    	<th>锁定原因</th>
    	<td><s:textarea label="原因" name="blockReason" value="%{blackList.blockReason}" cols="50" rows="3"></s:textarea></td>
    </tr>
    <tr>
    	<td colspan="2">
    		<input type="hidden" name="memberId" value="${memberId}"/>
				<input type="hidden" id="blackListId" name="blackListId" value="${blackListId}"/>
    		<input type="button" id="submitBtn" value="送出"/>
				<input type="button" id="cancelBtn" value="Cancel"/>
			</td>
    </tr>
	</table>
</s:form>